package edu.iit.cs553;

import java.io.IOException;

import org.apache.http.client.ClientProtocolException;

public class Main {

	/**
	 * @param args
	 * @throws IOException
	 * @throws ClientProtocolException
	 */
	public static void main(String[] args) throws ClientProtocolException, IOException, IncorrectArgumentsException
	{
		// Argument retrieval
		if (args.length != 2 || !args[0].equals("-i"))
		{
			throw new IncorrectArgumentsException();
		}
		int idleTimeTolerated;
		try
		{
			double idleTimeToleratedInDouble = Double.parseDouble(args[1]);
			idleTimeTolerated = (int) idleTimeToleratedInDouble;
		} catch (Exception e)
		{
			throw new IncorrectArgumentsException();
		}

		Worker worker = new Worker();
		worker.stopInstance();
	}
}
